<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        let json = {
            a: 1,
            b: 2
        };
        let newJson = new Proxy(json, {
            deleteProperty(target, property){
                console.log(`您要删除${property}属性`);
            },
            // 判断是否存在
            has(target, property){
              console.log('判断是否存在调用has方法');
              return property in target
            }
        })
        console.log( 'a' in newJson);
        delete newJson.a;
        console.log(newJson);
    </script>
</head>

<body>
</body>
</html>